package com.csd.activity;

import android.app.ActionBar;
import android.app.Activity;
import android.app.ActionBar.LayoutParams;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class PersonalDetailActivity extends Activity implements OnClickListener {

	private LinearLayout ll_fqa,ll_employee;
	private ActionBar actionBar;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_personaldetail);
		initView();
		initActionBar();
	}
	private void initView() {
		// TODO Auto-generated method stub
		ll_fqa = (LinearLayout) findViewById(R.id.fqa);
		ll_fqa.setOnClickListener(this);
		ll_employee = (LinearLayout) findViewById(R.id.employee);
		ll_employee.setOnClickListener(this);
	}
	private void initActionBar() {
		// TODO Auto-generated method stub
		actionBar = getActionBar();
		actionBar.setDisplayHomeAsUpEnabled(false);
		actionBar.setDisplayShowHomeEnabled(false);
		actionBar.setDisplayShowTitleEnabled(false);
		actionBar.setDisplayShowCustomEnabled(true);

		LayoutInflater inflator = (LayoutInflater) getSystemService(this.LAYOUT_INFLATER_SERVICE);

		View v = inflator.inflate(R.layout.actionbar_main, null);
		TextView title = (TextView) v.findViewById(R.id.title);
		title.setText("订单详情");
		ImageView img = (ImageView) v.findViewById(R.id.logo);
		img.setImageDrawable(getResources().getDrawable(R.drawable.u86));
		img.setOnClickListener(this);
		ActionBar.LayoutParams layout = new ActionBar.LayoutParams(
				LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
		actionBar.setCustomView(v, layout);

	}
	
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.fqa:
			Intent intent = new  Intent(PersonalDetailActivity.this, FqaActivity.class);
			startActivity(intent);
			break;
		case R.id.employee:
			Intent intent1 = new Intent(PersonalDetailActivity.this, EmployeeActivity.class);
			startActivity(intent1);
			break;
		case R.id.logo:
			finish();
			break;
		default:
			break;
		}
		
	}
}
